package com.zhw.mapper;

import com.github.pagehelper.Page;
import com.zhw.pojo.dto.AmountDTO;
import com.zhw.pojo.dto.CustomerConstituteDTO;
import com.zhw.pojo.dto.CustomerLossQueryDTO;
import com.zhw.pojo.vo.AmountVO;
import com.zhw.pojo.vo.CustomerLossReportVO;
import com.zhw.pojo.vo.CustomerServeReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface ReportMapper {

    Page<AmountVO> getAmount(AmountDTO amountDTO);

    @Select("select level,count(id) as total from customer\n" +
            "GROUP BY level")
    List<CustomerConstituteDTO> getCustomerConstitute();

    @Select("select total,ifnull(type,'其他') as type from serveReport")
    List<CustomerServeReport> getServeReport();


    Page<CustomerLossReportVO> getLose(CustomerLossQueryDTO customerLossQueryDTO);
}
